package 学习HashMap;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

public class temp {
    public static void main(String[] args) {
        HashMap<Object, Object> hashMap = new HashMap<>();
        hashMap.put(null,"1");
        hashMap.put(null,null);//K-V可以为空  k为空时，v值会被保存在table[0]
        System.out.println(hashMap.get(null));

        //--------
        System.out.println("------");

        ConcurrentHashMap<Object, Object> map = new ConcurrentHashMap<>();
        map.put(null,null); //K-V不可以为null 会报空指针错误
        System.out.println(map.get(null));
    }
}
